import { getReportData } from '@/api/data'

const state = {
  reportData: {}
}

const mutations = {
  SET_REPORT_DATA (state, reportData) {
    state.reportData = reportData
  }
}

const actions = { // this.$store.dispatch('data/getReportData')
  async getReportData ({commit}) {
    const result = await getReportData()
    console.log('----result', result)
    const reportData = result.data
    commit('SET_REPORT_DATA', reportData)
  }
}

export default {
  namespaced: true, // 指定当前vuex的模块外部访问需要指定模块的标识名称
  state,
  mutations,
  actions
}